<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!-- 加载公共的头部的样式 (jquery+bootstrap)-->
<%@ include file="/views/common/headerStyle.jsp"%> 
<title>test-form1</title>
</head>
<body>

<c:out value="测试controller(Handler,action)接收并绑定参数"/> <br/> 
<span>1.简单参数绑定</span> <br/> 
<span>2.包装类型参数绑定</span> <br/> 
<span>3.集合类型参数绑定</span> <br/>  

<hr>

<div class="context_box">
1.简单参数绑定
<hr/>
	<form class="form-inline" action="${BASE_PATH}home/helloworld/simpleparam" method="post">
	  <div class="form-group mb-2">
	    <label for="company_name" class=" col-form-label">公司名:</label>
	    <input type="text" class="form-control" name="company_name" value="陕西XX有限公司">
	  </div>
	  
	  <div class="form-group mb-2">
	    <label for="company_phone" class="col-form-label">电话:</label>
	    <input type="text" class="form-control" name="company_phone" value="02988888888">
	  </div>

	  <button type="submit" class="btn btn-primary mb-2">提交搜索</button>
	</form>



</div>


<div  class="context_box">
2.1包装类型参数绑定(一个类)
<hr/>
	<form class="form-inline" action="${BASE_PATH}home/helloworld/classparam" method="post">
	  <div class="form-group mb-2">
	    <label for="company_name" class="col-form-label">公司名:</label>
	    <input type="text" class="form-control" name="c_name" value="陕西XX有限公司">
	  </div>
	  
	  <div class="form-group mb-2">
	    <label for="company_phone" class="col-form-label">电话:</label>
	    <input type="text" class="form-control" name="c_tel" value="02988888888">
	  </div>

	  <button type="submit" class="btn btn-primary mb-2">提交搜索</button>
	</form>



</div>
<div  class="context_box">
2.2包装类型参数绑定(多类关联)
<hr/>
	<form class="form-inline" action="${BASE_PATH}home/helloworld/classparam2" method="post">
	  <div class="form-group mb-2">
	    <label for="company_name" class="col-form-label">公司名:</label>
	    <input type="text" class="form-control" name="company.c_name" value="陕西XX有限公司">
	  </div>
	  
	  <div class="form-group mb-2">
	    <label for="company_phone" class="col-form-label">电话:</label>
	    <input type="text" class="form-control" name="company.c_tel" value="02988888888">
	  </div>
	  
	  <div class="form-group mb-2">
	    <label for="company_type" class="col-form-label">类型:</label>
	    <input type="text" class="form-control" name="company.c_type.type_name" value="个体">
	  </div>
	  
	  <div class="form-group mb-2">
	    <label for="company_type" class="col-form-label">类型:</label>
	    <input type="text" class="form-control" name="company_type.type_name" value="个体22222">
	  </div>

	  <button type="submit" class="btn btn-primary mb-2">提交搜索</button>
	</form>



</div>
 
<div  class="context_box">
3.1 .集合类型参数绑定(list)
<hr/>
	<form class="form-inline" action="${BASE_PATH}home/helloworld/listparam" method="post">
		<div class="form-check form-check-inline">
			<label class="form-check-label" for="inlineRadio1">0</label>
			<input class="form-check-input" type="checkbox" name="companyAndType[0].company.id"  value="0">
			 <input type="text" class="form-control" name="companyAndType[0].company.c_name" value="陕西0有限公司" />
			 <input type="text" class="form-control" name="companyAndType[0].company.c_tel" value="02988888888" />
			 <input type="text" class="form-control" name="companyAndType[0].company.c_type.type_name" value="个体0" />
		</div>
		<div class="form-check form-check-inline">
			<label class="form-check-label" for="inlineRadio1">1</label>
			<input class="form-check-input" type="checkbox" name="companyAndType[1].company.id"  value="1">
			 <input type="text" class="form-control" name="companyAndType[1].company.c_name" value="陕西1有限公司" />
			 <input type="text" class="form-control" name="companyAndType[1].company.c_tel" value="02988888888" />
			 <input type="text" class="form-control" name="companyAndType[1].company.c_type.type_name" value="个体1" />
		</div>
		<div class="form-check form-check-inline">
			<label class="form-check-label" for="inlineRadio1">2</label>
			<input class="form-check-input" type="checkbox" name="companyAndType[2].company.id"  value="2">
			 <input type="text" class="form-control" name="companyAndType[2].company.c_name" value="陕西2有限公司" />
			 <input type="text" class="form-control" name="companyAndType[2].company.c_tel" value="02988888888" />
			 <input type="text" class="form-control" name="companyAndType[2].company.c_type.type_name" value="个体2" />
		</div>
		<div class="form-check form-check-inline">
			<label class="form-check-label" for="inlineRadio1">3</label>
			<input class="form-check-input" type="checkbox" name="companyAndType[3].company.id"  value="3">
			 <input type="text" class="form-control" name="companyAndType[3].company.c_name" value="陕西3有限公司" />
			 <input type="text" class="form-control" name="companyAndType[3].company.c_tel" value="02988888888" />
			 <input type="text" class="form-control" name="companyAndType[3].company.c_type.type_name" value="个体3" />
		</div>

	  <button type="submit" class="btn btn-primary mb-2">提交搜索</button>
	</form>

</div>



<div  class="context_box">
3.2 .集合类型参数绑定(map)
<hr/>
	<form class="form-inline" action="${BASE_PATH}home/helloworld/mapparam" method="post">
	  <div class="form-group mb-2">
	    <label for="company_name" class="col-form-label">公司名:</label>
	    <input type="text" class="form-control" name="company_name" value="陕西XX有限公司">
	  </div>
	  
	  <div class="form-group mb-2">
	    <label for="company_phone" class="col-form-label">电话:</label>
	    <input type="text" class="form-control" name="company_phone" value="02988888888">
	  </div>
	  
	  <div class="form-group mb-2">
	    <label for="company_type" class="col-form-label">类型:</label>
	    <input type="text" class="form-control" name="company_type" value="个体">
	  </div>

	  <button type="submit" class="btn btn-primary mb-2">提交搜索</button>
	</form>

</div>

<div>


<hr/>
${action_type}
<hr/>
${req_data }
</div>
 




</body>
<!-- 加载公共的底部的样式(jquery+bootstrap) -->
<%@ include file="/views/common/footerStyle.jsp"%> 
</html>